luci-mod-status: fix wrong position of channel for 5GHz radio
authorChristian Marangi <[email protected]>
Sun, 30 Jul 2023 20:58:57 +0000 (22:58 +0200)
committerChristian Marangi <[email protected]>
Sun, 30 Jul 2023 21:09:59 +0000 (23:09 +0200)
Channel tag for 5GHz radios is wrong and is confusing for any user
that wants to better identify the used channel from the graph.

Add some additional logic to better position the channel tag.

Fixes: #6419
Signed-off-by: Christian Marangi <[email protected]>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js

index 0c8cff8c0e0c3d5401d548e20b1838fd68dcea79..bd36f99dc5add0354d633bd023899bf722364ae3 100644 (file)
@@ -132,7 +132,13 @@ return view.extend({
                        chan_analysis.offset_tbl[channel] = curr_offset+step;
 
                        createGraphHLine(G,curr_offset+step);
-                       createGraphText(G,curr_offset+step, channel);
+                       if (is5GHz)
+                               if (channel < 100)
+                                       createGraphText(G,curr_offset-(step/2), channel);
+                               else
+                                       createGraphText(G,curr_offset-step, channel);
+                       else
+                               createGraphText(G,curr_offset+step, channel);
                        curr_offset += step;
 
                        if (is5GHz && freq_tbl[i+1]) {